package cn.doways.api.service.serviceimpl;

import cn.doways.api.mapper.ToolsMapper;
import cn.doways.api.service.ToolsService;
import cn.doways.api.utils.SmsSixNumberUtils;
import cn.doways.api.utils.SmsUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;


/**
 * @ClassName ToolsServiceImpl
 * @Description //TODO
 * @Author shellming
 * @Date 2019-08-11 00:02
 **/
@Service
public class ToolsServiceImpl implements ToolsService {

    private ToolsMapper toolsMapper;

    @Autowired
    public ToolsServiceImpl(ToolsMapper toolsMapper) {
        this.toolsMapper = toolsMapper;
    }

    @Override
    public String getSms(String phoneNumber) {
        return SmsUtils.sender(phoneNumber,SmsSixNumberUtils.make());
    }

    @Override
    public int updateFaceToken(String id, String faceToken) {
        return toolsMapper.updateFaceToken(id,faceToken);
    }

    @Override
    public String getFaceToken(String id) {
        return toolsMapper.getFaceToken(id);
    }
}
